/*
注意！
此类已经废除，本来用来显示鼠标指针位置的
由于出现不移动问题，此类已被我抛弃
所以在此不作注释
大家请自行理解
 */
package Frames;

import javax.swing.*;
import java.awt.*;

public class Cursor extends JFrame {
    public Cursor(){
        setSize(48,48);
        setUndecorated(true);
        getContentPane().setBackground(new Color(63, 203, 142));
    }
    public void moveTo(int x,int y,int next){
        int difX = x-getX();
        int difY = y-getY();
        double xs = difX*1.00/next;
        double ys = difY*1.00/next;
        Thread t = new Thread(){
            public void run(){
                while(Cursor.super.getX() != x ){
                    Cursor.super.setLocation((int)(Cursor.super.getX()+xs),(int)(Cursor.super.getY()+ys));
                    try {
                        Thread.sleep(1);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            }
        };
        t.start();
    }
}
